This page last changed on Mar 11, 2008.
eDocs Home > BEA AquaLogic Data Services Platform Documentation > Data Services Developer's Guide > Contents How To Test an Update ProcedureThis topic describes how to test an Update procedure in Test view in Studio. Configure Audit PropertiesTo test an Update procedure in Studio, you must submit a data graph in the Parameters box in Test view. A data graph is an XML structure with a root element of <sdo:datagraph> and a <changesummary> element. The easiest way to submit a data graph is to capture one from an audit. First, configure audit properties in the ALDSP Console. Configuring Audit Properties in the ALDSP ConsoleTo configure audit properties so that ALDSP generates data graphs:
Capture the Data GraphYou can then capture a data graph from the audit messages displayed in the Studio Console tab, and edit the data graph to submit to the Update procedure in Test view. Viewing a Data Graph in the Studio Console TabTo capture a data graph:
Submit the UpdateWhen you update relational sources, the SDO update mechanism uses optimistic locking to avoid change conflicts. With optimistic locking, the data source is not locked when the SDO client acquires the data. Later, when the client wants to update, the data in the source is compared to a copy of the data at a time when it was acquired. If there are discrepancies, the update is not committed. Before you submit the data graph to the Update procedure, be sure that optimistic locking is enabled in the underlying data source you are updating. You can then submit the data graph to the Update procedure. However, you may need to edit it, as the data graph you captured from the Studio Console tab reflected the last change you made, not the change you are presently submitting to the Update procedure. Submitting the Data Graph to the Update ProcedureThe data graph you submit to the Update procedure takes the place of the return type as an argument, even if you are updating only some of the elements in the return type. To submit the data graph to an Update procedure:
<sdo:datagraph xmlns:sdo="commonj.sdo"> <changeSummary> <sim:SIMPLE_CUSTOMER sdo:ref="#/sdo:datagraph/sim:SIMPLE_CUSTOMER" xmlns:sim="ld:logical/SimpleCustomer"> <CUSTOMER_SINCE>1999-01-01T00:00:00</CUSTOMER_SINCE> </sim:SIMPLE_CUSTOMER> </changeSummary> <sim:SIMPLE_CUSTOMER xmlns:sim="ld:logical/SimpleCustomer"> <CUSTOMER_ID>CUSTOMER7</CUSTOMER_ID> <CUSTOMER_SINCE>2007-11-11T00:00:00</CUSTOMER_SINCE> </sim:SIMPLE_CUSTOMER> </sdo:datagraph> This version has been updated in the Parameters box (note the difference in the CUSTOMER_SINCE dates): <sdo:datagraph xmlns:sdo="commonj.sdo"> <changeSummary> <sim:SIMPLE_CUSTOMER sdo:ref="#/sdo:datagraph/sim:SIMPLE_CUSTOMER" xmlns:sim="ld:logical/SimpleCustomer"> <CUSTOMER_SINCE>2007-11-11T00:00:00</CUSTOMER_SINCE> </sim:SIMPLE_CUSTOMER> </changeSummary> <sim:SIMPLE_CUSTOMER xmlns:sim="ld:logical/SimpleCustomer"> <CUSTOMER_ID>CUSTOMER7</CUSTOMER_ID> <CUSTOMER_SINCE>2008-04-04T00:00:00</CUSTOMER_SINCE> </sim:SIMPLE_CUSTOMER> </sdo:datagraph>
See AlsoConcepts
How TosOther Resources |
Document generated by Confluence on Apr 28, 2008 15:57 |